//
//  FavoriteCell.m
//  体育
//
//  Created by liujianlong on 2022/10/24.
//

#import "FavoriteCell.h"
@interface FavoriteCell()
@property (strong, nonatomic) IBOutlet FavoriteView *bgView;
@property (strong, nonatomic) IBOutlet UILabel *remark;
@property (strong, nonatomic) IBOutlet UIImageView *remarkImg;

@end
@implementation FavoriteCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (IBAction)actionForBtn:(UIButton *)sender {
    sender.selected = !sender.selected;
    if (self.block) {
        self.block(sender);
    }
}

- (void)setModel:(Record *)model{
    _model = model;
    self.bgView.model = model;
    self.remark.text = model.remark.length > 0 ? LS(model.remark) : LS(@"备注");
    if (model.imgs.count > 0) {
        self.remarkImg.image = [UIImage imageWithData:model.imgs[0]];
    }else{
        self.remarkImg.image = [UIImage imageNamed:@"图片"];
    }
}
@end
